home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-06 | 1.6 KB | 79 lines | [TEXT/MSET] |
- :class pictScroll super{ picture }
- vscrollbar VScrollControl
- hscrollbar HScrollControl
- graphicRect frame
-
- :m position:
- get: frame { l t r b -- }
- r 1- ( x) t ( y) b t - ( len) init: VScrollControl
- l ( x) b 1- ( y) r l - ( len) init: HScrollControl
- l t moveto: super
- l t r b put: temprect 1 1 inset: temprect
- get: temprect setScrollRect: VScrollControl
- get: temprect setScrollRect: HScrollControl
-
- 0 ( lo) width: super width: frame - 5 + ( hi) putrange: HScrollControl
- 0 ( lo) height: super height: frame - 5 + ( hi) putrange: VScrollControl
- ;m
-
- :m classinit:
- 50 50 150 150 put: frame
- position: self
- ;m
-
- :m draw:
- get: frame { l t r b -- }
- l get: HScrollControl - ( x)
- t get: VScrollControl - ( y) moveTo: super
-
- get: frame put: temprect 1 1 inset: temprect temprect call ClipRect draw: super
- 0 0 32000 32000 put: temprect temprect call ClipRect \ no clipping
- draw: frame
- draw: VScrollControl
- draw: HScrollControl
- ;m
-
- :m new: { wptr -- }
- wptr new: super
- wptr new: VScrollControl
- wptr new: HScrollControl
- self scrolledBy: VScrollControl
- self scrolledBy: HScrollControl
- position: self
- ;m
-
- :m hit?: ( -- b )
- hit?: VScrollControl
- hit?: HScrollControl or
- ;m
-
- :m click:
- hit?: VScrollControl IF click: VScrollControl THEN
- hit?: HScrollControl IF click: HScrollControl THEN
- ;m
-
- :m activate:
- activate: VScrollControl
- activate: HScrollControl ;m
-
- :m deactivate:
- deactivate: VScrollControl
- deactivate: HScrollControl ;m
-
- ;class
-
- endload
-
-
- \ *** EXAMPLE USE ***
-
- \ Make sure that the resource file Selection.rsrc
- \ has been placed into your Mops ƒ folder.
-
- " Selection.rsrc" OpenResFile
-
- selwindow w
- pictScroll p
- test: w
- p add: w
-